﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;

namespace ERP.ERPSystem.RBAC.Dto
{
    public class UserDto : EntityDto<int>
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名不能为空")]
        public string userName { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        [RegularExpression(@"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,}$", 
            ErrorMessage = "密码必须至少6个字符，包含字母和数字")]
        public string userPassWord { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Required(ErrorMessage = "昵称不能为空")]
        public string userNickName { get; set; }

        /// <summary>
        /// 部门Id
        /// </summary>
        [Required(ErrorMessage = "请选择部门")]
        public int departmentId { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string departmentName { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "手机号不能为空")]
        [RegularExpression(@"^1[3-9]\d{9}$", ErrorMessage = "请输入正确的手机号")]
        public string userPhone { get; set; }
    }
}
